﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 系统应用字段
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("系统应用字段")]
	[BindTable("sys_Field", Description = "系统应用字段", ConnName = "System")]
	public partial class sys_Field
	{
		#region 属性
		private Int32 _FieldID;
		/// <summary>
		/// 应用字段ID号
		/// </summary>
		[Description("应用字段ID号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "FieldID", "应用字段ID号", "", "int", 10, 0, false)]
		public Int32 FieldID
		{
			get { return _FieldID; }
			set { if (OnPropertyChanging("FieldID", value)) { _FieldID = value;   } }
		}

		private String _F_Key;
		/// <summary>
		/// 应用字段关键字
		/// </summary>
		[Description("应用字段关键字")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(2, "F_Key", "应用字段关键字", "", "varchar(50)", 0, 0, false)]
		public String F_Key
		{
			get { return _F_Key; }
			set { if (OnPropertyChanging("F_Key", value)) { _F_Key = value;   } }
		}

		private String _F_CName;
		/// <summary>
		/// 应用字段中文说明
		/// </summary>
		[Description("应用字段中文说明")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(3, "F_CName", "应用字段中文说明", "", "nvarchar(50)", 0, 0, true)]
		public String F_CName
		{
			get { return _F_CName; }
			set { if (OnPropertyChanging("F_CName", value)) { _F_CName = value;   } }
		}

		private String _F_Remark;
		/// <summary>
		/// 描述说明
		/// </summary>
		[Description("描述说明")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(4, "F_Remark", "描述说明", "", "nvarchar(200)", 0, 0, true)]
		public String F_Remark
		{
			get { return _F_Remark; }
			set { if (OnPropertyChanging("F_Remark", value)) { _F_Remark = value;   } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "FieldID" : return _FieldID;
					case "F_Key" : return _F_Key;
					case "F_CName" : return _F_CName;
					case "F_Remark" : return _F_Remark;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "FieldID" : _FieldID = Convert.ToInt32(value); break;
					case "F_Key" : _F_Key = Convert.ToString(value); break;
					case "F_CName" : _F_CName = Convert.ToString(value); break;
					case "F_Remark" : _F_Remark = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得系统应用字段字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
			///<summary>
			/// 应用字段ID号
			///</summary>
			public const String FieldID = "FieldID";

			///<summary>
			/// 应用字段关键字
			///</summary>
			public const String F_Key = "F_Key";

			///<summary>
			/// 应用字段中文说明
			///</summary>
			public const String F_CName = "F_CName";

			///<summary>
			/// 描述说明
			///</summary>
			public const String F_Remark = "F_Remark";
		}
		#endregion
	}
}